package org.cybzacg.encryption.factory;

import org.cybzacg.encryption.enums.EncryptionAlgorithm;

import java.util.List;
import java.util.Collections;

/**
 * 工厂统计信息类
 * 提供加密器工厂的统计信息
 * 
 * @author encryption team
 * @version 1.0
 */
public class FactoryStatistics {
    
    private final int creatorCount;
    private final int cacheSize;
    private final List<EncryptionAlgorithm> supportedAlgorithms;
    
    /**
     * 构造函数
     * 
     * @param creatorCount 创建器数量
     * @param cacheSize 缓存大小
     * @param supportedAlgorithms 支持的算法列表
     */
    public FactoryStatistics(int creatorCount, int cacheSize, List<EncryptionAlgorithm> supportedAlgorithms) {
        this.creatorCount = creatorCount;
        this.cacheSize = cacheSize;
        this.supportedAlgorithms = Collections.unmodifiableList(supportedAlgorithms);
    }
    
    /**
     * 获取创建器数量
     * 
     * @return 创建器数量
     */
    public int getCreatorCount() {
        return creatorCount;
    }
    
    /**
     * 获取缓存大小
     * 
     * @return 缓存大小
     */
    public int getCacheSize() {
        return cacheSize;
    }
    
    /**
     * 获取支持的算法列表
     * 
     * @return 支持的算法列表
     */
    public List<EncryptionAlgorithm> getSupportedAlgorithms() {
        return supportedAlgorithms;
    }
    
    /**
     * 获取支持的算法数量
     * 
     * @return 支持的算法数量
     */
    public int getSupportedAlgorithmCount() {
        return supportedAlgorithms.size();
    }
    
    @Override
    public String toString() {
        return "FactoryStatistics{" +
                "creatorCount=" + creatorCount +
                ", cacheSize=" + cacheSize +
                ", supportedAlgorithmCount=" + getSupportedAlgorithmCount() +
                '}';
    }
}
